package cn.sdormitory.controller;

import cn.sdormitory.common.dto.ResultMsg;
import cn.sdormitory.service.AppMonthlyStatisticsService;
import cn.sdormitory.smartdor.entity.DeptDormitorySummary;
import cn.sdormitory.smartdor.entity.MonthlyStatisticsDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @className: AppMonthlyStatisticsController
 * @author: Alex
 * @date: 2024/12/3
 **/
@RestController
@RequestMapping("/app/statistics")
@Api("APP端月度统计接口")
public class AppMonthlyStatisticsController {
	
	@Resource
	private AppMonthlyStatisticsService appMonthlyStatisticsService;
	
	@ApiOperation(" => APP端月度考勤汇总列表  -部门经理查看")
	@GetMapping(value = "/getDeptDormitorySummary")
	public ResultMsg getDeptDormitorySummary(String userId, String month, String operateType) {
		List<MonthlyStatisticsDetail> resultList = appMonthlyStatisticsService.getMonthlyDeptDormitorySummary(userId, month, operateType);
		return ResultMsg.BY_SUCCESS("获取成功", resultList);
	}
	
	@ApiOperation(" => APP端月度学生考勤次数  -部门经理查看")
	@GetMapping(value = "/getMonthlyStudentDormitorySummary")
	public ResultMsg getMonthlyStudentDormitorySummary(String classId, String month, String operateType) {
		List<MonthlyStatisticsDetail> studentList = appMonthlyStatisticsService.getMonthlyStudentDormitorySummary(classId, month, operateType);
		return ResultMsg.BY_SUCCESS("获取成功", studentList);
	}

}
